

let CommonModule = {
  providers: [CommonService],
  exports: [CommonService]
}
class OtherService {
  CommonService
}
let OtherModule = {
  providers: [OtherService],
  exports: [OtherService]
}
class AppController {
  OtherService
}
let appModule = {
  imports: [CommonModule, OtherModule],
  controllers: [AppController]
}
let providerInstance = {
  CommonService: new CommonService(),
  OtherService: new OtherService()
}
let moduleProviders = {
  appModule: new Set(),
  commonModule: new Set(CommonService),
  otherModule: new Set(OtherService)
}

function getProviderByToken(CommonService, CommonModule) {
  moduleProviders.get(CommonModule).has(CommonService)
  providerInstance.get(CommonService)
}

// A模块引用B模块 B模块导入导出C模块 C模块导入并导出D模块 D模块里有一个exports[DService]
// A B C D模块 都可以使用DService